<include file="Public:header" />


<div class="outside users">
    <div class="inner">

        <!-- 右边侧栏 -->
        <include file="Public:sidenav" />

        <!-- 个人信息 -->
        <div class="user_inner">
            <div class="page_title icons_user">个人信息</div>
            <form id="form3" name="form3" method="post" action="__URL__user_modify">
                <input type="hidden" name="ID" value="{$user.id}">
                <table width="100%" >
                    <tr>
                        <td align="right"> <font class="red">*</font>
                            姓名：
                        </td>
                        <td>
                            <input class="check" type="text" name="name" value="{$user.name}" />
                        </td>
                        <td align="right">&nbsp;</td>
                        <td rowspan="5" align="right" valign="top">
                            <div>
                                <p align="center">
                                    <img
                                           <if condition="($user.head_img eq '' )"> src="__APP__/Public/Uploads/head/head.jpg" alt="头像" name="" width="90" height="110" align="middle" />

                                                <else />  src="__APP__/{$user.head_img}" alt="头像" name="" width="90" height="110" align="middle" />
                                    </if>

                                </p>
                                <p align="center">
                                    <a id="set" href="#">修改</a>
                                    |
                                    <a id="head_del" href="#">删除</a>
                                </p>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right"> <font class="red">*</font>
                            性别：
                        </td>
                        <td>
                            <label>
                                <input type="radio" name="sex" value="男"  <if condition="$user.sex eq '男' ">checked</if> />
                                男
                                <input type="radio" name="sex" value="女" <if condition="$user.sex eq '女' ">checked</if> />
                                女
                            </label>
                        </td>
                        <td align="right">&nbsp;</td>
                    </tr>
                    <tr>
                        <td align="right">
                            <font class="red">*</font>
                            出生日期：
                        </td>
                        <td>
                            <label>
                                <select size="1" name="year" id="year" onfocus="years('year',new Date().getFullYear()),change_date()" onchange="change_date()" >
                                           <option>{$date.0}</option>
                                </select>
                                年
                                <select   size="1" name="month" id="month"  onfocus="months(),change_date()" onchange="change_date()" >
                                           <option>{$date.1}</option>
                                </select>
                                月
                                <select size="1" name="date" id="date" >
                                          <option>{$date.2}</option>
                                </select>
                                日
                            </label>
                        </td>
                        <td align="right">&nbsp;</td>
                    </tr>
                    <tr>
                        <td align="right">
                            <font class="red">*</font>
                            民族：
                        </td>
                        <td>
                            <input class="check" type="text" name="mingzu"  value="{$user.mingzu}" />
                        </td>
                        <td align="right">&nbsp;</td>
                    </tr>
                    <tr>
                        <td align="right">
                            <font class="red">*</font>
                            最高学历：
                        </td>
                        <td>
                            <input class="check"  type="text" name="xueli" value="{$user.xueli}" />
                        </td>
                        <td align="right">&nbsp;</td>
                    </tr>
                    <tr>
                        <td align="right">
                            <font class="red">*</font>
                            户籍所在地：
                        </td>
                        <td>
                            <input class="check" type="text" name="huji" value="{$user.huji}" />
                        </td>

                        <td align="right">
                            <font class="red">*</font>
                            婚姻状况：
                        </td>
                        <td>
                            <select style="width:25%" name="married">
                                <option value="未婚" <if condition="$user.married eq '未婚' ">selected</if> >未婚</option>
                                <option value="已婚" <if condition="$user.married eq '已婚' ">selected</if> >已婚</option>
                            </select>
                        </td>


                    </tr>
                    <tr>

                        <td align="right">
                            <font class="red">*</font>
                            联系电话：
                        </td>
                        <td>
                            <input class="check" type="text" name="mobile" value="{$user.mobile}" />
                        </td>

                        <td align="right">工作经验( 年 )：</td>
                        <td>
                            <input type="text" name="work_expe" value="{$user.work_expe}" />
                        </td>


                    </tr>
                    <tr>
                        <td align="right">
                            <font class="red">*</font>
                            通讯地址：
                        </td>
                        <td>
                            <input class="check" type="text" name="address" value="{$user.address}" />
                        </td>
                        <td align="right">政治面貌：</td>
                        <td>
                            <input type="text" name="policy" value="{$user.policy}" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right">身高：</td>
                        <td>
                            <input type="text" name="height" value="{$user.height}" />
                            cm
                        </td>
                        <td align="right">健康状况：</td>
                        <td>
                            <input type="text" name="health" value="{$user.health}" />
                        </td>
                    </tr>
                </table>
                <p align="center">
                    <input type="submit" class="submit" name="Submit322" value="保存修改" />
                </p>
            </form>

            <div class="confrim">

                <div class="upload">
                    <div class="title">
                        上传图片
                        <a id="close" href="#">
                            <img src="__PUBLIC__/images/icons/close.jpg" alt=""></a>
                    </div>
                    <form class="indepent" action="__URL__upload" method="post" enctype="multipart/form-data" name="form4" id="imag_upload">

                        <table width="100%" >
                            <tr>
                                <td align="right" width="70%">
                                    上传地址：
                                    <input  style="width:200px"  id="upload"  type="file" name="file" />
                                </td>
                                <td>
                                    <input type="submit" class="submit" value="上传图片"></td>
                            </tr>
                        </table>
                        <p align="center">
                            （*照片尺寸90*110px，大小不能超过200K）
                        </p>
                    </form>
                </div>
            </div>

        </div>
        <!-- /个人信息 -->
    </div>
</div>

<script>

    function years(obj, Cyear) {
        var len = 134; // select长度,即option数量
        var selObj = document.getElementById(obj);
        var selIndex = len - 1;
        var newOpt; // OPTION对象

        // 循环添加OPION元素到年份select对象中
        for (i = 1; i <= len; i++) {
            if (selObj.options.length != len) { // 如果目标对象下拉框升度不等于设定的长度则执行以下代码
                newOpt = window.document.createElement("OPTION"); // 新建一个OPTION对象
                newOpt.text = Cyear - len + i; // 设置OPTION对象的内容
                newOpt.value = Cyear - len + i; // 设置OPTION对象的值
                selObj.options.add(newOpt, i); // 添加到目标对象中
            }

        }
    }

    function months(){
        var month = document.getElementById("month");
        month.length = 0;
        for (i = 1; i < 13; i++) {
            if(i<10){
                month.options.add(new Option('0'+i, '0'+i));
            }else {
                month.options.add(new Option(i, i));
            }

        }

    }


    function change_date(){
        // var birthday = document.birthday;
        var year  = document.getElementById("year");
        var month = document.getElementById("month");
        var day   = document.getElementById("date");
        vYear  = parseInt(year.value);
        vMonth = parseInt(month.value);
        date.length=0;

        //根据年月获取天数
        var max = (new Date(vYear,vMonth, 0)).getDate();
        for (var i=1; i <= max; i++) {
            if(i<10){
                date.options.add(new Option('0'+i, '0'+i));
            }else
            date.options.add(new Option(i, i));
        }
    }

    $(function(){
       $('#head_del').click(function() {
        $.ajax({
            type: 'GET',
            url: "__URL__user_modify/del/{$user.id}",
            success: function (data) {
                location.reload()
            },
            error: function (data) {

            }
          })
       })
    })
</script>





<include file="Public:footer" />

